Skip to content

Conversation

coado
Copy link
Contributor

@coado coado commented Jun 16, 2025

Summary:

This PR connects breaking change detection with a danger bot. The action takes snapshot from main branch and from the PR as inputs to diff-api-snapshot (saved in runner temp directory).

Changelog:

[Internal]

Test Plan:

Tested on my react-native fork coado#19

Screenshot 2025-07-01 at 10 54 45

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Jun 16, 2025
@facebook-github-bot
Copy link
Contributor

@coado has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

coado added a commit to coado/react-native that referenced this pull request Jun 23, 2025
Summary:
This is a work in progress PR that adds breaking change detection to danger.

The danger is ran on a base revision from which there is no easy access to the API snapshot from the PR. The Github action fetches the PR and stores the "current" snapshot in the temporary directory which is then used in the `diff-api-snapshot` script. It is compared to the previous snapshot from the base revision which can be easily accessed by reading from `packages/react-native/ReactNativeApi.d.ts`.


## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests


Test Plan:
Tested on react-native fork with personal access token. 

 {F1979339175} 

#16

Differential Revision: D76735630

Pulled By: coado
@coado coado force-pushed the @dmalecki/diff-api-snap-danger branch from 0d79ef4 to e11aca5 Compare June 23, 2025 08:17
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76735630

@facebook-github-bot
Copy link
Contributor

@coado has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

coado added a commit to coado/react-native that referenced this pull request Jun 30, 2025
Summary:
This is a work in progress PR that adds breaking change detection to danger.



## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests


Reviewed By: huntie

Differential Revision: D76735630

Pulled By: coado
@coado coado force-pushed the @dmalecki/diff-api-snap-danger branch from 631437c to 71937d2 Compare June 30, 2025 13:51
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76735630

coado added 5 commits July 1, 2025 02:04
Summary:

This diff commits our V2 JavaScript API snapshot for React Native.

This is a new format and workflow that replaces the previous `public-api-test` Jest test.

Please look at the file header for up-to-date instructions on updating the API snapshot.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77532617
Summary:

This diff adds excution of `yarn build-types --validate` to run RN JS API snapshot validation on CI.

### Motivation

Detect react-native public API changes before they land.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76340729
Summary:

This diff deletes `public-api-test` for detecting changes in public API. It is replaced with public API snapshot validation (in D76340729) for better detection and understanding of changes that influence external interfaces.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D77531763
)

Summary:

This diff aligns breaking change detection script with new snapshot format. It compares hashes to determine if the API changed for each specifier.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D77377762
Summary:
This is a work in progress PR that adds breaking change detection to danger.



## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests


Reviewed By: huntie

Differential Revision: D76735630

Pulled By: coado
@coado coado force-pushed the @dmalecki/diff-api-snap-danger branch from 71937d2 to 8e4a9e7 Compare July 1, 2025 09:04
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76735630

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 1, 2025
@facebook-github-bot
Copy link
Contributor

@coado merged this pull request in b41b924.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants